package com.neusoft.neuiotms.dcom.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_servicelevel")
@org.hibernate.annotations.Table(appliesTo = "neuiot_servicelevel", comment = "服务水平")
public class ServiceLevel extends AbstractAuditModel {
    private static final long serialVersionUID = 7724831428191577877L;

    @NotBlank(message = "服务水平标题")
    @Length(max = 255, message = "服务水平标题不能超过{max}位")
    @Column(length = 255, nullable = false)
    private String title;

    @Lob
    @Column(columnDefinition = "longtext")
    private String content;

    @Column(length = 32, nullable = true)
    private Integer readingVolume = 0;

    @NotBlank(message = "创建人编码")
    @Length(max = 255, message = "创建人编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    private String userCode;

    @Length(max = 255, message = "创建人名称不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String userName;

    @Length(max = 255, message = "更新人编码不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String updateUserCode;

    @Length(max = 255, message = "更新人名称不能超过{max}位")
    @Column(length = 255, nullable = true)
    private String updateUserName;

    /**
     * 附件存储，用||分割多个文件；用@@分割fsId和文件name <br />
     * 16109709907255005.png@@报警通知.png||16109709907255001.png@@报警通知2.png
     */
    @Column(length = 2047, nullable = true)
    private String attachment;

    /**
     * 逗号分割
     */
    @Column(length = 2047, nullable = true)
    private String keywords;

}
